home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 14 / Hot Mix 14.iso / HTML / vendors / finesse / examples / examples_sh < prev   
Text File  |  1996-06-27  |  2KB  |  72 lines

  1. #! /bin/sh
  2. # FINESSEAPPLICATIONKEY sEClCi?FSj`iJ
  3.  
  4. # sh script initialization
  5. . ${FINESSEPATH-/usr/local/finesse}/fsshinit
  6.  
  7. examplespath=${FINESSEPATH-/usr/local/finesse}/examples
  8. shdir=$examplespath/sh
  9. XUSERFILESEARCHPATH=\
  10. $examplespath/app-defaults/%N:$XUSERFILESEARCHPATH
  11. export XUSERFILESEARCHPATH
  12.  
  13. display_example()
  14. {
  15.   Fsecho -e; Fsecho -f $1 -p beginning -r 10 -c 80
  16. }
  17.  
  18. # define examples and main window
  19.  
  20. nrows=4; ftag=f; ctag=ck
  21.  
  22. j=0; k=0
  23. examples="FsForm -name mainform;"
  24.  
  25. for i in `ls $shdir`
  26. do
  27.   k=`expr $j / $nrows`
  28.   if expr $j % $nrows > /dev/null
  29.   then
  30.     formvar=
  31.   else
  32.     formvar="FsForm -name $ftag$k
  33.                -orientation horizontal
  34.                -parent mainform;"
  35.   fi
  36.   examples="$examples $formvar
  37.             FsForm -name $ftag$i -parent $ftag$k;
  38.             FsPushButton -label $i -parent $ftag$i
  39.               -name $i -winstat touch;
  40.         FsCheck -var $ctag$i -items 'x'
  41.               -name $ctag$i -parent $ftag$i
  42.               -fsbutton $ctag$i -winstat touch;"
  43.   rmcklabel="$rmcklabel -r $ctag$i[3]:labelString:"
  44.   j=`expr $j + 1`
  45. done
  46.  
  47. mainwin="
  48.  FsWindow -name main;
  49.  $examples
  50.  FsSeparator;
  51.  FsPushButton -label OK;"
  52.  
  53. # Finesse dialog
  54.  
  55. Fsopen
  56. display_example $examplespath/`basename $0`
  57. Fsdisplay -w "$mainwin" $rmcklabel
  58. while :
  59. do
  60.   case $fsbutton in
  61.     OK|a) break;;
  62.     $ctag*) updtck= ;;
  63.     *) display_example $shdir/$fsbutton
  64.        updtck="-r $ctag$fsbutton[3]:set:True"
  65.        (unset FSREADFILE FSWRITEFILE;
  66.           $shdir/$fsbutton);;
  67.   esac
  68.   Fsdisplay -n main $updtck
  69. done
  70. Fssave
  71. Fsclose
  72.